﻿@using BlueLight.Web.Options
@using Microsoft.Extensions.Options
@using RuoVea.ExEnum
@using RuoVea.OmiApi.Dict.Entitys
@using RuoVea.OmiApi.Dict.Service
@inject IOptionsMonitor<SystemInfo> systemInfo;
@inject IOptionsMonitor<OrgInfo> orgInfo;
@inject SysDictTypeService sysDictTypService;
@{
    SysDictType systeminfo = await sysDictTypService.GetTypeAndDataByCodeAsync("SYSTEMINFO");
    string? title = systeminfo?.Children?.Where(x => x.Code == "Title")?.Select(x => x.Value)?.FirstOrDefault();
    string? keywords = systeminfo?.Children?.Where(x => x.Code == "Keywords")?.Select(x => x.Value)?.FirstOrDefault();
    string? description = systeminfo?.Children?.Where(x => x.Code == "Description")?.Select(x => x.Value)?.FirstOrDefault();
    string? copyRigth = systeminfo?.Children?.Where(x => x.Code == "CopyRigth")?.Select(x => x.Value)?.FirstOrDefault();
    // 友情链接
    SysDictType friendshiplink = await sysDictTypService.GetTypeAndDataByCodeAsync("FRIENDSHIPLINK");
    // 下载
    var download = (await sysDictTypService.GetTypeAndDataByCodeAsync("DOWNLOAD"))?.Children?.FirstOrDefault();
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@(ViewData["Title"] + " " + (title ?? systemInfo.CurrentValue.Title))</title>
    <meta name="keywords" content="@Html.Raw(keywords ?? systemInfo.CurrentValue.Keywords)">
    <meta name="description" content="@Html.Raw(description ?? systemInfo.CurrentValue.Description)">
    <link href="~/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="~/lib/css/bl-css.css" rel="stylesheet">
    <link href="~/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="~/lib/aos/dist/aos.css" rel="stylesheet">
    @await RenderSectionAsync("Styles", required: false)
</head>
<body>
    <div class="bl-header container-fluid">
        <div class="container">
            <nav class="navbar navbar-expand-lg navbar-dark bl-nav">
                <a class="nav-prand" href="/home">@Html.Raw(title ?? systemInfo.CurrentValue.Title)</a>
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item @((Context.Request.Path == "/home" || Context.Request.Path == "/" || Context.Request.Path == "") ? "active" : "")">
                            <a href="/home">首页 <span class="sr-only">(current)</span></a>
                        </li>
                        <li class="nav-item @((Context.Request.Path == "/aritical.html" || Context.Request.Path.StartsWithSegments("/details", StringComparison.OrdinalIgnoreCase)) ? " active" : "" ) ">
                            <a href="/aritical.html">文章</a>
                        </li>
                        <li class="nav-item @((Context.Request.Path == "/about.html" || Context.Request.Path.StartsWithSegments("/about", StringComparison.OrdinalIgnoreCase)) ? "active" : "")">
                            <a href="/about.html">关于</a>
                        </li>
                    </ul>
                </div>
                @if ((download?.IsDisable)== YesOrNot.N){
                    <button type="button" class="btn btn-outline-light"><a href="@download?.ExtData">@Html.Raw(download?.Label)</a></button>
                }
            </nav>
        </div>
    </div>
    @RenderBody()
    <div class="bl-footer container-fluid">
        <div class="container">
            <ul class="bl-footer-list">
                @foreach (var item in friendshiplink?.Children??new List<SysDictValue>())
                {
                    <li class="bl-footer-item">
                        <a href="@item.ExtData">@Html.Raw(item.Label)</a>
                    </li>
                }
            </ul>
            <div class="copyright">@Html.Raw(copyRigth ?? orgInfo.CurrentValue.CopyRigth)</div>
        </div>
    </div>
    <script src="~/lib/jquery/jquery.min.js"></script>
    <script src="~/lib/bootstrap/js/bootstrap.min.js"></script>
    <script src="~/lib/aos/dist/aos.js"></script>
    <script>AOS.init();</script>
    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>